package br.com.troca.carro.dao;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import br.com.troca.carro.vo.Marca;

@Repository
public class MarcaDAOImpl implements MarcaDAO {

	@Autowired
	private SessionFactory sessionFactory;

	@Transactional
	public void incluir(Marca objeto) {
		sessionFactory.getCurrentSession().save(objeto);
	}

	@Transactional
	public void alterar(Marca objeto) {
		sessionFactory.getCurrentSession().update(objeto);
	}

	@Transactional
	public void excluir(Marca objeto) {
		sessionFactory.getCurrentSession().delete(objeto);
	}

}
